package org.demo.patten.factory;

/**
 * @author zhuj
 * @date 2025/3/21
 * @apiNote
 */
public class SimpleFactory {
    public static Product createProduct(String type) {
        if ("A".equals(type)) return new ProductA();
        if ("B".equals(type)) return new ProductB();
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
